package org.example;

import org.openjdk.jol.info.ClassLayout;

/**
 * @Author: jixiaotian.ch@qq.com
 * @Date : 2020/9/3
 */
public class ClassLayoutDemo {
    public static void main(String[] args) {
        //启用指针压缩:-XX:+UseCompressedOops，禁止指针压缩:-XX:-UseCompressedOops
        //打开偏向锁：-XX:+UseBiasedLocking -XX:BiasedLockingStartupDelay=0
        ClassLayoutDemo classLayoutDemo = new ClassLayoutDemo();
        synchronized (classLayoutDemo) {
        System.out.println("locking ");
        System.out.println(ClassLayout.parseInstance(classLayoutDemo).toPrintable());

        }
    }
}
